package com.yt.system.dao;

import com.yt.system.domain.Applyresource;
import com.yt.system.domain.Resource;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface ResourceMapper {
    int deleteByPrimaryKey(Integer rid);

    int insert(Resource record);

    int insertSelective(Resource record);

    Resource selectByPrimaryKey(Integer rid);

    int updateByPrimaryKeySelective(Resource record);

    int updateByPrimaryKey(Resource record);

    List<Integer> selectResourceType();  //查询所有资源类型

    @Select("select * from resource ")
    List<Resource> findAllResource();

    @Select("select * from resource where type = #{type}")
    List<Resource> selectResourceByType(Integer type);  //根据资源类型查找资源

}